package com.cskaoyan.mapper;

import com.cskaoyan.bean.admin.system.PermissonsVo;
import com.cskaoyan.bean.admin.system.SystemPermissionsBean;
import com.cskaoyan.bean.pojo.Role;
import com.cskaoyan.bean.pojo.RoleExample;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;

public interface RoleMapper {
    long countByExample(RoleExample example);

    int deleteByExample(RoleExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Role record);

    int insertSelective(Role record);

    List<Role> selectByExample(RoleExample example);

    Role selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    List<Role> selectAll();

    List<String> selectAllName();

    //批量插入
    int multiInsert(@Param("roleId") int roleId, @Param("permissions") List<String> permissions, @Param("addTime") Date addTime);

    List<String> selectPermissionsByRoleId(@Param("roleId") Integer roleId);

    String selectIdAndLabel(@Param("assignedPermission") String assignedPermission);

    String selectChildrenXIdAndLabel(@Param("assignedPermission") String assignedPermission);

    String selectChildrenLabel(@Param("assignedPermission") String assignedPermission);

    String selectChildrenApi(@Param("assignedPermission") String assignedPermission);

    List<SystemPermissionsBean> selectAllSystemPermissons();

    int deleteOldPermissions(@Param("roleId") int roleId);

    String selectNameById(@Param("roleId") Integer roleId);
}